package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.Feedback;
import com.micro.modual.model.bo.feedback.FeedbackBO;

/**
 * <h1>意见反馈表 延展类</h1>
 *
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:27
 */
public class FeedbackExtension {

    /**
     * <h2>转换: 意见反馈表 新增</h2>
     *
     * @param feedbackBO {@link FeedbackBO} 意见反馈表 新增/修改 请求对象
     * @return {@link Feedback} 意见反馈表
     */
    public static Feedback converAddFeedback(FeedbackBO feedbackBO) {
        Feedback feedback = new Feedback();
        feedback.setId(SnowFlakeUtil.getId());
        feedback.setUserCode(feedbackBO.getUserCode());
        feedback.setUserName(feedbackBO.getUserName());
        feedback.setFeedbackImage(feedbackBO.getFeedbackImage());
        feedback.setFeedbackContent(feedbackBO.getFeedbackContent());
        feedback.setCreateTime(feedbackBO.getCreateTime());
        feedback.setReadStatus(feedbackBO.getReadStatus());
        feedback.setFeedbackIp(feedbackBO.getFeedbackIp());
        feedback.setFeedbackVersion(feedbackBO.getFeedbackVersion());
        feedback.setFeedbackChannel(feedbackBO.getFeedbackChannel());
        return feedback;
    }

    /**
     * <h2>转换: 意见反馈表 修改</h2>
     *
     * @param feedbackBO {@link FeedbackBO} 意见反馈表 新增/修改 请求对象
     * @return {@link Feedback} 意见反馈表
     */
    public static Feedback converEditFeedback(FeedbackBO feedbackBO) {
        Feedback feedback = new Feedback();
        feedback.setId(feedbackBO.getId());
        feedback.setUserCode(feedbackBO.getUserCode());
        feedback.setUserName(feedbackBO.getUserName());
        feedback.setFeedbackImage(feedbackBO.getFeedbackImage());
        feedback.setFeedbackContent(feedbackBO.getFeedbackContent());
        feedback.setCreateTime(feedbackBO.getCreateTime());
        feedback.setReadStatus(feedbackBO.getReadStatus());
        feedback.setFeedbackIp(feedbackBO.getFeedbackIp());
        feedback.setFeedbackVersion(feedbackBO.getFeedbackVersion());
        feedback.setFeedbackChannel(feedbackBO.getFeedbackChannel());
        return feedback;
    }
}
